﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentValidation;
using Microhard.WarehouseInsp.Buz.Models;

namespace Microhard.WarehouseInsp.Buz.Validator
{
    public class OutInPutApplyModelValidator : AbstractValidator<OutInPutApplyModel>
    {
        public OutInPutApplyModelValidator()
        {
            RuleSet("Insert", () =>
            {
                RuleFor(u => u.OutInPutApplyID).NotNull().NotEmpty();
                RuleFor(u => u.ApplyDate).NotNull().NotEmpty();
                RuleFor(u => u.PredictOutDate).NotNull().NotEmpty();
            });

            RuleSet("Update", () =>
            {
                RuleFor(u => u.OutInPutApplyID).NotNull().NotEmpty();
                RuleFor(u => u.ApplyDate).NotNull().NotEmpty();
                RuleFor(u => u.PredictOutDate).NotNull().NotEmpty();

            });
        }
    }
}
